package org.hegang.design.first.adapterpattern.demo2;

/**
 * @ClassName CableHandleAdapter
 * @Describe: 这种方式可以处理很多接口类型的网线，只需要添加内部的私有属性
 * @Author: gang.he
 * @Date: Created in 14:29 2021/4/22
 * @Modified:
 * @Version: V1.0
 */
public class HandleAdapter implements Adapter {

    private Cable cable;

    public HandleAdapter(Cable cable){
        this.cable = cable;
    }

    @Override
    public void handleCable() {
        System.out.println("适配器正在处理Cable网线");
        cable.cable();
        System.out.println("网线接口处理成功，可以上网");
    }
}
